Μερικές Διαφορικές Εξισώσεις

Ακριβής ετοιματζίδικη λύση

Στήσιμο ΜΔΕ.

Clear["Global`*"]
PDE = D[u[x, t], t] == D[u[x, t], {x, 2}]
bound1 = u[0, t] == 0
bound2 = u[Pi, t] == 0
bound3 = Derivative[1, 0][u][0, t] == Exp[-4 t]
bound4 = Derivative[1, 0][u][Pi, t] == -(Cosh[Pi]) Exp[-4 t]
init = u[x, 0] == Sin[x] Cosh[x]
\[u^{(0,1)}(x,t)=u^{(2,0)}(x,t)\]
\[u(0,t)=0\]
\[u(\pi ,t)=0\]
\[u^{(1,0)}(0,t)=E^{-4 t}\]
\[u^{(1,0)}(\pi ,t)=-(E^{-4 t}) \cosh(\pi )\]
\[u(x,0)=\cosh(x) \sin(x)\]

Λύση ΜΔΕ.

DSolve[{PDE, bound1, bound2, bound3, bound4, init}, 
  u[x, t], {x, t}] // FullSimplify

Αριθμητική λύση

Στήσιμο ΜΔΕ.

Clear["Global`*"]
PDE = D[u[t, x], t] == D[u[t, x], {x,2}]
init = u[0, x] == 0
bound1 = u[t, 0] == Sin[t]
bound2 = u[t, 5] == 0
\[u^{(1,0)}(t,x)=u^{(0,2)}(t,x)\]
\[u(0,x)=0\]
\[u(t,0)=\sin(t)\]
\[u(t,5)=0\]

Αριθμητική λύση

NDSolve[{PDE, init, bound1, bound2}, u, {t, 0, 10}, {x, 0, 5}];

Σχεδίαση

Plot3D[Evaluate[u[t, x] /. %], {t, 0, 10}, {x, 0, 5},  PlotRange -> All]
3D Plot